package cn.javaeye.lonlysky.lforum.entity.web;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.xidea.lite.servlet.DateUtils;

import cn.javaeye.lonlysky.lforum.entity.forum.Users;

@Entity
@Table(name = "t_info")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Info implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5977606672694984629L;
	private Integer id;
	/**
	 * 类别
	 */
	private ParentType parentType; 
	private Users  user;

	/**
	 * 发布日期
	 */
	private String infoDate;
	/**
	 * 有限期
	 */
	private String endDate;

	/**
	 * 价格
	 */
	private String price;

	/**
	 * 地点
	 */
	private String place;

	/**
	 * 联系电话
	 */
	private String contart;

	/**
	 * 设施
	 */
	private String ss;
	/**
	 * 内容
	 */
	private String content;
	/**
	 * 访问量
	 */
	private String times="0";
	/**
	 * 标题
	 */
	private String title;
	/**
	 * url
	 */
	private String url;

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "increment")
	@Column(name = "id", unique = true, nullable = true, insertable = true, updatable = true)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "pid", unique = false, nullable = true, insertable = true, updatable = true)
	public ParentType getParentType() {
		return parentType;
	}
	public void setParentType(ParentType parentType) {
		this.parentType = parentType;
	}
	@Column(name = "infoDate", unique = false, nullable = true, insertable = true, updatable = true)
	public String getInfoDate() {
		return infoDate;
	}
	public void setInfoDate(String infoDate) {
		this.infoDate = DateUtils.getDateStr();
	}
	@Column(name = "endDate", unique = false, nullable = true, insertable = true, updatable = true)
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	@Column(name = "price", unique = false, nullable = true, insertable = true, updatable = true)
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	@Column(name = "place", unique = false, nullable = true, insertable = true, updatable = true)
	public String getPlace() {
		return place;
	}
	public void setPlace(String place) {
		this.place = place;
	}

	@Column(name = "contart", unique = false, nullable = true, insertable = true, updatable = true)
	public String getContart() {
		return contart;
	}
	public void setContart(String contart) {
		this.contart = contart;
	}
	@Column(name = "ss", unique = false, nullable = true, insertable = true, updatable = true)
	public String getSs() {
		return ss;
	}
	public void setSs(String ss) {
		this.ss = ss;
	}
	@Column(name = "content", unique = false, nullable = true, insertable = true, updatable = true)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "time", unique = false, nullable = true, insertable = true, updatable = true)
	public String getTimes() {
		return times;
	}
	@Column(name = "title", unique = false, nullable = false, insertable = true, updatable = true)
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public void setTimes(String times) {
		this.times = times;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "userid", unique = false, nullable = true, insertable = true, updatable = true)
	public Users getUser() {
		return user;
	}
	public void setUser(Users user) {
		this.user = user;
	}
	@Column(name = "url", unique = false, nullable = true, insertable = true, updatable = true)
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	
}
